<?php
@include('include/common.inc.php');	
@include('logincleck.php');	
if($_POST['add']==1)
{		
	$hou_num = work_str($_POST["hou_num"], 1);			//中文标题  
	$tel = work_str($_POST["tel"], 1);		
	
	$addr = work_str($_POST["addr"], 1);			
	$date = $_POST["m"]."月".$_POST["d"]."日".$_POST["h"]."時".$_POST["i"]."分";	
	$typex = work_str($_POST["type"], 1);
	$mess = work_str($_POST["mess"], 1);
	$time =date('Y-m-d H:i:s');
	$mem_id = $_SESSION['mem_id'];		
	$sel = "select * from $TBL_HOUSE where num=$hou_num";		
	$result = mysql_query($sel);
	$count = mysql_num_rows($result);		
	if($count==0)
	{
		 MyNotice("Success!", 1, "news.php");
	}else{
		$insert = "insert into $TBL_REINFO (id,hou_num,tel,addr,date,type,mess,datetime,mem_id)
		values (null,'$hou_num','$tel','$addr','$date','$typex','$mess','$time','$mem_id')";			
		if(mysql_query($insert))
		{
			MyNotice("租出回報提交成功", 2, "index.php");
		}else{
			MyNotice("租出回報提交失敗", 1, "login.php");
		}
	}
	
}
@include('right.php');
//@include('number.php');//验证码
$smarty->assign("mem_id",$_SESSION['mem_id']);
$smarty->assign("type",$_SESSION['type']);
$smarty->display('reback.html');

?>